import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { knowledge } from '@/api/apiModulesType';

// 查询分发(get接口post传参)
export const ApiPerQueryDistribute = (query?: any): AxiosPromise<any[]> => {
  return request({
    method: 'get',
    url: `/${knowledge}/api/filesDistribute/queryDistribute`,
    params: query
  });
};

// 查询接收(get接口post传参)
export const ApiPerQuerySend = (query?: any): AxiosPromise<any[]> => {
  return request({
    method: 'get',
    url: `/${knowledge}/api/filesDistribute/querySend`,
    params: query
  });
};
//链接分享查询
export const ApiPerSharePerson = (query?: any): AxiosPromise<any[]> => {
  return request({
    method: 'get',
    url: `/${knowledge}/api/filesShare/sharePerson`,
    params: query
  });
};
//主页个人空间信息
export const userGetHomepageApi = (query?: any): AxiosPromise<any[]> => {
  return request({
    method: 'get',
    url: `/system/user/get/homepage`,
    params: query
  });
};

// 常用知识库查询
export const knowledgeEnterpriseFilesTreeQueryCommonKnowLab = (query?: any): AxiosPromise<any[]> => {
  return request({
    method: 'get',
    url: `knowledge/enterpriseFilesTree/queryCommonKnowLab`,
    params: query
  });
};
// 分类下知识库数据分析图数据
export const knowledgeEnterpriseFilesTreeAnalysisData = (query?: any): AxiosPromise<any[]> => {
  return request({
    method: 'get',
    url: `knowledge/enterpriseFilesTree/analysisData`,
    params: query
  });
};
// 统计使用频率
export const aiqaWikiAppsCountInfo = (query?: any): AxiosPromise<any[]> => {
  return request({
    method: 'get',
    url: `/aiqa/wiki/apps/count_info`,
    params: query
  });
};

export default{
  ApiPerQueryDistribute,
  ApiPerQuerySend,
  ApiPerSharePerson,
  userGetHomepageApi,
  knowledgeEnterpriseFilesTreeQueryCommonKnowLab,
  knowledgeEnterpriseFilesTreeAnalysisData,
  aiqaWikiAppsCountInfo
}